package org.jeecg.modules.business.outbound.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.business.outbound.entity.WmsOutReceiptTaskMaterial;
import org.jeecg.modules.business.outbound.entity.WmsOutReceiptTaskMaterialExport;
import org.jeecg.modules.business.outbound.entity.dto.WmsOutReceiptTaskDTO;
import org.jeecg.modules.business.outbound.vo.WmsOutReceiptTaskMaterialResponseVO;

import java.util.List;

/**
 * @Description: 出库任务-物料
 * @Author: jeecg-boot
 * @Date:   2023-08-09
 * @Version: V1.0
 */
public interface WmsOutReceiptTaskMaterialMapper extends BaseMapper<WmsOutReceiptTaskMaterial> {

	/**
	 * 通过主表id删除子表数据
	 *
	 * @param mainId 主表id
	 * @return boolean
	 */
	public boolean deleteByMainId(@Param("mainId") String mainId);

  /**
   * 通过主表id查询子表数据
   *
   * @param mainId 主表id
   * @return List<WmsOutReceiptTaskMaterial>
   */
	public List<WmsOutReceiptTaskMaterial> selectByMainId(@Param("mainId") String mainId);

	/**
	 * 出库任务-物料主表ID分页查询
	 * @param page
	 * @param id
	 * @param name
	 * @param deviceType
	 * @return
	 */
    IPage<WmsOutReceiptTaskMaterialResponseVO> queryPageTaskMaterialByTaskId(@Param("page") IPage<WmsOutReceiptTaskMaterial> page,
																			 @Param("id") String id,
																			 @Param("name") String name,
																			 @Param("deviceType")String deviceType,
																			 @Param("unCompleted")Integer unCompleted);
	public List<WmsOutReceiptTaskMaterialExport> listOutMaterialExportByTask(@Param("vo") WmsOutReceiptTaskDTO wmsOutReceiptTaskDTO);

	/**
	 * 通过任务id查询出库任务物料信息带灯信息
	 * @param taskId
	 * @return
	 */
	List<WmsOutReceiptTaskMaterialResponseVO> getListByTaskIdWithLight(@Param("taskId") String taskId,@Param("code") String code,@Param("unCompleted") Boolean unCompleted,@Param("batchCode") String batchCode);
}
